package com.yuwei.database.dao

import androidx.room.Dao
import androidx.room.Insert
import androidx.room.Query
import androidx.room.Update
import com.yuwei.database.entity.AddressEntity
@Dao
interface AddressDao {
    @Insert
    suspend fun insertAddress(addressEntity: AddressEntity)

    @Query("SELECT * FROM address_info")
    suspend fun getAll(): List<AddressEntity>

    @Query("SELECT * FROM address_info WHERE is_default = 1")
    suspend fun getDefaultAddress(): AddressEntity

    @Update
    suspend fun update(addressEntity: AddressEntity)
}